package com.gjy.convert;

import com.fasterxml.jackson.databind.ObjectMapper;

/**
 * @author 宫静雨
 * @version 1.0
 * @since 2022-12-02 15:38:58
 */
public class JsonToObject {

    public static <T> T parse(String json, Class<T> cls) throws Exception {
//        T t = cls.newInstance();
        ObjectMapper mapper = new ObjectMapper();
        return mapper.readValue(json, cls);
    }
}
